From: Tassilo Horn Date: Wed, 25 May 2011 19:34:33 +0000 (+0200) Subject: Add org.gnome.shell.enabled-extensions complementing disabled-extensions X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8215 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=33a3b8046d9028dd1e3d3e3f5da526ef087f1692;p=gnome-shell.git Add org.gnome.shell.enabled-extensions complementing disabled-extensions If the former is empty (default), only the extensions not contained in the latter are loaded. Else, all extensions in the former that are not contained in the latter are loaded. https://bugzilla.gnome.org/show_bug.cgi?id=651088 --- diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in index 698ebc1ea..050c4130b 100644 --- a/data/org.gnome.shell.gschema.xml.in +++ b/data/org.gnome.shell.gschema.xml.in @@ -15,8 +15,18 @@ [] <_summary>Uuids of extensions to disable <_description> - GNOME Shell extensions have a uuid property; - this key lists extensions which should not be loaded. + GNOME Shell extensions have a uuid property; this key lists extensions + which should not be loaded. This setting overrides enabled-extensions + for extensions that appear in both lists. + + + + [] + <_summary>Uuids of extensions to enable + <_description> + GNOME Shell extensions have a uuid property; this key lists extensions + which should be loaded. disabled-extensions overrides this setting for + extensions that appear in both lists. diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index 9dd3a47ef..f722007fc 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -23,8 +23,9 @@ const ExtensionType = { const extensionMeta = {}; // Maps uuid -> importer object (extension directory tree) const extensions = {}; -// Array of uuids +// Arrays of uuids var disabledExtensions; +var enabledExtensions; // GFile for user extensions var userExtensionsDir = null; @@ -178,6 +179,7 @@ function init() { } disabledExtensions = global.settings.get_strv('disabled-extensions', -1); + enabledExtensions = global.settings.get_strv('enabled-extensions', -1); } function _loadExtensionsIn(dir, type) { @@ -195,7 +197,10 @@ function _loadExtensionsIn(dir, type) { if (fileType != Gio.FileType.DIRECTORY) continue; let name = info.get_name(); - let enabled = disabledExtensions.indexOf(name) < 0; + // Enable all but disabled extensions if enabledExtensions is not set. + // If it is set, enable one those, except they are disabled as well. + let enabled = (enabledExtensions.length == 0 || enabledExtensions.indexOf(name) >= 0) + && disabledExtensions.indexOf(name) < 0; let child = dir.get_child(name); loadExtension(child, enabled, type); }